package com.wyk.greendaodemo.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.wyk.greendaodemo.greendao.gen.HourData;
import com.wyk.greendaodemo.greendao.gen.MonthData;
import com.wyk.greendaodemo.greendao.gen.User;

import com.wyk.greendaodemo.greendao.gen.HourDataDao;
import com.wyk.greendaodemo.greendao.gen.MonthDataDao;
import com.wyk.greendaodemo.greendao.gen.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig hourDataDaoConfig;
    private final DaoConfig monthDataDaoConfig;
    private final DaoConfig userDaoConfig;

    private final HourDataDao hourDataDao;
    private final MonthDataDao monthDataDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        hourDataDaoConfig = daoConfigMap.get(HourDataDao.class).clone();
        hourDataDaoConfig.initIdentityScope(type);

        monthDataDaoConfig = daoConfigMap.get(MonthDataDao.class).clone();
        monthDataDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        hourDataDao = new HourDataDao(hourDataDaoConfig, this);
        monthDataDao = new MonthDataDao(monthDataDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(HourData.class, hourDataDao);
        registerDao(MonthData.class, monthDataDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        hourDataDaoConfig.getIdentityScope().clear();
        monthDataDaoConfig.getIdentityScope().clear();
        userDaoConfig.getIdentityScope().clear();
    }

    public HourDataDao getHourDataDao() {
        return hourDataDao;
    }

    public MonthDataDao getMonthDataDao() {
        return monthDataDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
